<!DOCTYPE html >
<html>
<head>
    <link rel="stylesheet" href="demos.css" type="text/css" media="screen" />
    
    <script src="../libraries/RGraph.common.core.js" ></script>
    <script src="../libraries/RGraph.common.dynamic.js" ></script>
    <script src="../libraries/RGraph.common.effects.js" ></script>
    <script src="../libraries/RGraph.pie.js" ></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <!--[if lt IE 9]><script src="../excanvas/excanvas.js"></script><![endif]-->

    <title>The (old) front page Pie chart</title>
    
    <meta name="robots" content="noindex,nofollow" />
    <meta name="description" content="The (old) front page Pie chart" />
     
</head>
<body>

    <h1>The (old) front page Pie chart</h1>
    
    <p>
        This is the Pie chart from the front page. It starts with the RoundRobin effect and allows you to click to explode
        the Pie chart segments.
    </p>

    <canvas id="cvs" width="350" height="250">[No canvas support]</canvas>
    
    <script>
        $(document).ready(function ()
        {
            var pie = new RGraph.Pie({
                id: 'cvs',
                data: [9,5,12,8,4,9],
                options: {
                    strokestyle: '#e8e8e8',
                    linewidth: 2,
                    shadow: {
                        self: true,
                        blur: 5,
                        offsetx: 5,
                        offsety: 5,
                        color: '#aaa'
                    },
                    exploded: 10,
                    radius: 80,
                    labels: {
                        self: ['Mavis','Kevin','Luis','June','Olga','Luis','Pete','Bridget'],
                        sticks:true,
                        length: 15
                    }
                }
            }).on('click', function (e, shape)
            {
                var index = shape.index;
                var obj = shape.object;
                
                // Reset all the segments to 10
                obj.set('exploded', 10);
                
                obj.explodeSegment(index, 15);
                
                e.stopPropagation();
            }).on('mousemove', function (e, shape)
            {
                e.target.style.cursor = 'pointer';
            })

            
            !RGraph.ISIE || RGraph.ISIE9UP ? pie.roundRobin({frames:30}) : pie.draw();

            
            window.addEventListener('mousedown', function (e)
            {
                pie.set('exploded', 10);
            }, true);
        })
    </script>

    <p>        
        <a href="./">&laquo; Back</a>
    </p>

</body>
</html>